<div id="issue-file-<%= file.signed_id %>" class="p-4 flex gap-2 justify-between items-stretch hover:bg-primary-50 rounded-md">
  <div class="flex gap-4 items-center grow">
    <div class="flex items-center min-w-12 max-w-12 justify-center text-primary text-4xl">
      <%= link_to rails_blob_path(file, description: "attachment"), class: "flex items-center", target: '_blank' do %>
        <% if file.representable? %>
          <%= image_tag file.representation(resize_to_limit: [100, 100]), class: 'w-auto' %>
        <% else %>
          <%= icon_for(:files) %>
        <% end %>
      <% end %>
    </div>
    <div class="text-base-content text-base flex grow flex-col">
      <span class="text-xs text-italic" ><%= file.filename %></span>
      <span  class="text-sm"><%= number_to_human_size(file.byte_size, precision: 2) %></span>
    </div>
  </div>

  <div class="flex items-center">
    <%= link_to rails_blob_path(file, description: "attachment"),
      class: "btn btn-ghost btn-sm",
      target: '_blank' do %>
      <i class="ti ti-download"></i>
    <% end %>

    <button data-issue-detail-file-url-param="<%= rails_blob_url(file, description: "attachment") %>" data-action="click->issue-detail#copyToClipboard" class="btn btn-ghost btn-sm">
      <i class="hidden text-success ti ti-check"></i>
      <i class="text-base-content ti ti-copy"></i>
    </button>

    <%= link_to issue_file_path(issue, blob_signed_id: file.signed_id),
      class: "btn btn-ghost btn-sm btn-error",
      data: { turbo_method: :delete,
      turbo_confirm: t("confirmations.delete_file") } do %>
      <i class="ti ti-trash"></i>
    <% end %>
  </div>
</div>